<?php 
error_reporting( error_reporting() & ~E_NOTICE );
session_start();
if(isset($_SESSION['userid'])){
	$HoraReporte = date('H');
	if ($_SESSION['userid'] != "temporal") {
		if ($HoraReporte < 6 || $HoraReporte > 18) {
			echo '<script type="text/javascript"> var r = confirm(\'Usted está consultando una jornada no acorde a la hora actual. ¿Desea ser redireccionado a la jornada 2, comprendida entre 18 Hrs. a 6 Hrs.?\'); if(r==true){window.location.href=\'L1_1A_reporteJornada2.php?m=1A\';} </script>';	
		}
	}	
	if (isset($_GET['m'])) {
		$maquina = @$_GET['m'];

		if ($maquina != null) {
			if ($maquina == "1A") {

			}else if($maquina == "1B"){
				header('Location: L1_1B_reporteJornada1.php');
			}else if($maquina == "2A"){
				header('Location: L1_2A_reporteJornada1.php');
			}else if($maquina == "2B"){
				header('Location: L1_2B_reporteJornada1.php');
			}else if($maquina == "3A"){
				header('Location: L1_3A_reporteJornada1.php');
			}else if($maquina == "3B"){
				header('Location: L1_3B_reporteJornada1.php');
			}else if($maquina == "4A"){
				header('Location: L1_4A_reporteJornada1.php');
			}else if($maquina == "4B"){
				header('Location: L1_4B_reporteJornada1.php');
			}else if($maquina == "5A"){
				header('Location: L1_5A_reporteJornada1.php');
			}else if($maquina == "5B"){
				header('Location: L1_5B_reporteJornada1.php');
			}
		}
	}	
	ob_start();
	$LineaMaquinaTubo = "L1_1A";
	$jornada = 1;
	$fecha1;
	$fecha2;
	if ($jornada == 1) {
	//jornadad de 6pm del dia anterior a 6am del dia actual
		$fecha1 = date('Y-m-d',strtotime("-1 days")) . " 18:00:00.000";
		$fecha2 = date('Y-m-d') . " 06:00:00";
	}else{
	//jornada 2
	//jornadad de 6am del dia actual a 6pm del dia actual
		$fecha1 = date('Y-m-d') . " 06:00:00.000";
		$fecha2 = date('Y-m-d') . " 18:00:00";
	}
	include_once "FrontendManager.php";
	$db_frnmanager = new FrontendManager();
	?>
	<!DOCTYPE html>
	<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>Sitio de Reportes</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="description" content="">
		<meta name="author" content="">
		<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>

<!--[if lt IE 9]>
	<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->

	<!--link rel="stylesheet/less" href="less/bootstrap.less" type="text/css" /-->
	<!--link rel="stylesheet/less" href="less/responsive.less" type="text/css" /-->
	<!--script src="js/less-1.3.3.min.js"></script-->
	<!--append ‘#!watch’ to the browser URL, then refresh the page. -->
	<!--[if lt IE 9]><script language="javascript" type="text/javascript" src="excanvas.js"></script><![endif]-->
	
	<script language="javascript" type="text/javascript" src="js/jquery.jqplot.min.js"></script>
	<link rel="stylesheet" type="text/css" href="css/jquery.jqplot.css" />

	<link href="css/bootstrap.min.css" rel="stylesheet">
	<link href="css/style.css" rel="stylesheet">	
	

	<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
  <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
    <![endif]-->

    <!-- Fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="img/apple-touch-icon-57-precomposed.png">
    <link rel="shortcut icon" href="img/favicon.ico">

    
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/scripts.js"></script>

    <!-- BEGIN GRAFICAS -->
    <link class="include" rel="stylesheet" type="text/css" href="css/jquery.jqplot.min.css" />
    <link rel="stylesheet" type="text/css" href="css/examples.min.css" />
    <link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shCoreDefault.min.css" />
    <link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shThemejqPlot.min.css" />


    <!-- Don't touch this! -->


    <script class="include" type="text/javascript" src="js/jquery.jqplot.min.js"></script>
    <script type="text/javascript" src="syntaxhighlighter/scripts/shCore.min.js"></script>
    <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.min.js"></script>
    <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushXml.min.js"></script>
    <!-- End Don't touch this! -->

    <!-- Additional plugins go here -->
    <script class="include" type="text/javascript" src="plugins/jqplot.cursor.min.js"></script>
    <script class="include" type="text/javascript" src="plugins/jqplot.dateAxisRenderer.min.js"></script>
    <script class="include" type="text/javascript" src="plugins/jqplot.logAxisRenderer.min.js"></script>
    <!-- End additional plugins -->

    <!-- END GRAFICAS-->


    <!--BEGIN SCRIPTS/CSS GRAFICOS -->
    <!-- css's -->
    <link class="include" rel="stylesheet" type="text/css" href="css/jquery.jqplot.min.css" />
    <link rel="stylesheet" type="text/css" href="css/examples.min.css" />
    <link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shCoreDefault.min.css" />
    <link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shThemejqPlot.min.css" />

    <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="js/excanvas.min.js"></script><![endif]-->
    <script class="include" type="text/javascript" src="js/jquery.min.ie.js"></script>
    <!-- END SCRIPTS/CSS GRAFICOS -->
    <style>
    	/* Set the fixed height of the footer here */
    	#push,
    	#footer {
    		height: 60px;
    	}
    	#footer {
    		background-color: #eee;
    	}

    	/* Lastly, apply responsive CSS fixes as necessary */
    	@media (max-width: 767px) {
    		#footer {
    			margin-left: -20px;
    			margin-right: -20px;
    			padding-left: 20px;
    			padding-right: 20px;
    		}
    	}
    </style>

    <!-- SCRIPT PARA TOMAR SCREENSHOT -->
    <script type="text/javascript" src="testJs/html2canvas.js"></script>

</head>

<body>
	<div class="container">
		<!-- <button onClick="window.print()">Print this page</button>
		<div class="input-append date" id="datetimepicker" data-date="12-02-2012" data-date-format="dd-mm-yyyy">
			<input size="16" type="text" value="12-02-2012" readonly>
			<span class="add-on"><i class="icon-th"></i></span>
		</div> -->
		<div class="row clearfix">
			<div class="col-md-12 column">
				<nav class="navbar navbar-default" role="navigation">
					<div class="navbar-header">
						<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button> <a class="navbar-brand" href="#">FritoLay</a>
					</div>

					<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
						<ul class="nav navbar-nav">
							<li>
								<a href="L1_1A_consulta.php?m=1A">Consultas</a>
							</li>
							<li>
								<a href="L1_1A_Treal.php?m=1A">Tiempo Real</a>
							</li>	
							<li class="active">
								<a href="L1_1A_reporteJornada1.php?m=1A">Jornada 1</a>
							</li>
							<li>
								<a href="L1_1A_reporteJornada2.php?m=1A">Jornada 2</a>
							</li>					
							<li class="dropdown">
								<a href="#" class="dropdown-toggle" data-toggle="dropdown">Reportes<strong class="caret"></strong></a>
								<ul class="dropdown-menu">								
									<li class="divider">
									</li>
									<li>
										<a href="reportes_Treal">Reportes Tiempo Real</a>
									</li>
									<li>
										<a href="reportes_Consulta">Reportes de Consultas</a>
									</li>
									<li>
										<a href="reportes_Jornada1">Reportes de Jornada 1</a>
									</li>
									<li>
										<a href="reportes_Jornada2">Reportes de Jornada 2</a>
									</li>
									<li>
										<a href="reportes_JornadaTotal">Reportes de Jornada Total</a>
									</li>	
									<li class="divider">
									</li>							
								</ul>
							</li>
							<li class="dropdown">
								<a href="#" class="dropdown-toggle" data-toggle="dropdown">Ayuda<strong class="caret"></strong></a>
								<ul class="dropdown-menu">								
									<li class="divider">
									</li>
									<li>
										<a href="#" onClick="manualTecnico()" >Manual T&eacute;cnico</a>
									</li>
									<li>
										<a href="#" onClick="manualUsuario()" >Manual de Usuario</a>
									</li>								
									<li class="divider">
									</li>							
								</ul>
							</li>							
						</ul>	
						<ul class="nav navbar-nav navbar-right">
							<li>
								<a href="CerrarSesion.php">Cerrar Sesi&oacute;n</a>
							</li>
						</ul>				
					</div>				
				</nav>	
				
				<div class="tabbable" id="tabs-572768">
					<ul class="nav nav-tabs">
						<li class="active">
							<a href="#tab-linea1" data-toggle="tab">Linea 1500</a>
						</li>
						<li>
							<a href="#tab-linea2" data-toggle="tab">Linea 2</a>
						</li>
						<li>
							<a href="#tab-linea3" data-toggle="tab">Linea 3</a>
						</li>
						<li>
							<a href="#tab-linea4" data-toggle="tab">Linea 4</a>
						</li>
						<li>
							<a href="#tab-linea5" data-toggle="tab">Linea 5</a>
						</li>
						<li>
							<a href="#tab-linea6" data-toggle="tab">Linea 6</a>
						</li>
						<li>
							<a href="#tab-linea7" data-toggle="tab">Linea 7</a>
						</li>
					</ul>
					<div class="tab-content">
						<!-- Begin TAB LINEA 1-->
						<div class="tab-pane active" id="tab-linea1">							
							<!-- BEGIN TABBED DE MAQUINAS EN LINEA 1-->
							<div class="tabbable" id="tabbedLinea1Maquina1">
								<ul class="nav nav-tabs">
									<li class="active">
										<a href="#tab-linea1-maquina1.php">Maquina 1A</a>
									</li>
									<li>
										<a href="L1_1B_reporteJornada1.php">Maquina 1B</a>
									</li>
									<li>
										<a href="L1_2A_reporteJornada1.php">Maquina 2A</a>
									</li>
									<li>
										<a href="L1_2B_reporteJornada1.php">Maquina 2B</a>
									</li>
									<li>
										<a href="L1_3A_reporteJornada1.php">Maquina 3A</a>
									</li>
									<li >
										<a href="L1_3B_reporteJornada1.php">Maquina 3B</a>
									</li>
									<li>
										<a href="L1_4A_reporteJornada1.php">Maquina 4A</a>
									</li>
									<li>
										<a href="L1_4B_reporteJornada1.php">Maquina 4B</a>
									</li>
									<li>
										<a href="L1_5A_reporteJornada1.php">Maquina 5A</a>
									</li>
									<li>
										<a href="L1_5B_reporteJornada1.php">Maquina 5B</a>
									</li>						
								</ul>
								<div class="jumbotron">
									<div class="container">
										<h2>Reportes Autom&aacute;ticos</h2>
										<h3>Jornada 1, Maquina 1 Tubo A</h3>
										<h4>De 18:00 horas del 
											<?php 
											$fechaAnterior = date('d-m-Y',strtotime("-1 days")); 
											echo $fechaAnterior;
											?> 
											a las 06:00 del 
											<?php 
											$fechaAnterior = date('d-m-Y'); 
											echo $fechaAnterior;
											?> 
										</h4>
									</div>
								</div>
								<div class="well">
									<div class="btn-group btn-group-xl">
										<button class="btn btn-default" type="button" title="Exportar a PDF" onclick="hola()">
											<em class="glyphicon glyphicon-file"></em> 
											Exportar PDF
										</button> 
										<button class="btn btn-default" type="button">
											<em class="glyphicon glyphicon-download-alt"></em>
										</button>
										<button class="btn btn-default" type="button">
											<em class="glyphicon glyphicon-floppy-save"></em>
										</button> 
										<button class="btn btn-default" type="button">
											<em class="glyphicon glyphicon-align-justify"></em>
										</button>
									</div>
								</div>
								<div class="tab-content">
									<!-- Begin TAB LINEA 1-->
									<div class="tab-pane active" id="tab-linea1-maquina1">
										<!-- BEGIN CONTENIDO LINEA 1, MAQUINA 1 -->
										<div class="row clearfix">
											<div class="col-md-12 column">
												<div class="panel panel-primary">
													<div class="panel-heading">
														<h3 class="panel-title">
															Estadisticas
														</h3>
													</div>
													<div class="panel-body">											
														<table class="table table-striped">
															<thead>
																<tr>
																	<th>
																		Estadistica
																	</th>
																	<th>
																		Valor
																	</th>
																</tr>
															</thead>
															<tbody>
																<tr>								
																	<td>
																		Velocidad Promedio
																	</td>
																	<td>
																		<!-- velocidad promedio -->
																		<?php 
															// echo $fecha1;
															// echo " - ";
															// echo $fecha2;
																		$result = $db_frnmanager->getEstadisticasTiempoReal($fecha1, $fecha2, $LineaMaquinaTubo);
																		$velPromedioj1;
																		$unidadesProducidasj1;
																		$UnidadesDesperdicioj1;
																		$cantidadParosj1;
																		$tiempoMinutosj1;
																		$tiempoSegundosj1;

																		while( $row = sqlsrv_fetch_array( $result, SQLSRV_FETCH_NUMERIC) ) {
																			$velPromedioj1 = $row[0];
																			$unidadesProducidasj1 = $row[1];
																			$UnidadesDesperdicioj1 = $row[2];
																			$cantidadParosj1 = $row[3];
																			$tiempoMinutosj1 = $row[4];
																			$tiempoSegundosj1 = $row[5];
																		}
																		if ($velPromedioj1 == null) {
																			$velPromedioj1 = "0";
																		}
																		if ($unidadesProducidasj1 == null) {
																			$unidadesProducidasj1 = "0";
																		}
																		if ($UnidadesDesperdicioj1 == null) {
																			$UnidadesDesperdicioj1 = "0";
																		}
																		if ($cantidadParosj1 == null) {
																			$cantidadParosj1 = "0";
																		}
																		if ($tiempoMinutosj1 == null) {
																			$tiempoMinutosj1 = "0";
																		}
																		if ($tiempoSegundosj1 == null) {
																			$tiempoSegundosj1 = "0";
																		}

																		echo $velPromedioj1;
																		?>
																	</td>								
																</tr>
																<tr class="active">								
																	<td>
																		Unidades Producidas
																	</td>
																	<td>
																		<?php 															
																		echo $unidadesProducidasj1;
																		?>
																	</td>								
																</tr>
																<tr class="success">								
																	<td>
																		Unidades Desperdicio
																	</td>
																	<td>
																		<?php 															
																		echo $UnidadesDesperdicioj1;
																		?>
																	</td>								
																</tr>
																<tr class="warning">								
																	<td>
																		Numero de Paros
																	</td>
																	<td>
																		<?php 															
																		echo $cantidadParosj1;
																		?>
																	</td>								
																</tr>
																<tr class="danger">								
																	<td>
																		Tiempo Muerto en Minutos
																	</td>
																	<td>
																		<?php 															
																		echo $tiempoMinutosj1;
																		?>
																	</td>								
																</tr>
																<tr>								
																	<td>
																		Tiempo Muerto en Segundos
																	</td>
																	<td>
																		<?php 															
																		echo $tiempoSegundosj1;
																		?>
																	</td>								
																</tr>
															</tbody>
														</table>
													</div>
													<div class="panel-footer">
														Descripcion de las estadisticas
													</div>
												</div>
											</div>
										</div>
										<div class="row clearfix">
											<div class="col-md-12 column">
												<div class="panel panel-primary">
													<div class="panel-heading">
														<h3 class="panel-title">
															Velocidad Promedio por hora.
															<span class="badge" id="info1"></span>
														</h3>
													</div>
													<div class="panel-body">
														<!-- La grafica va justo aca... -->											
														<div class="container pull-left" id="chart1" style="padding-left: 5px; padding-right: 5px; width:100%; height:400px;">
														</div>												
														<script class="code" type="text/javascript">$(document).ready(function(){
															$.jqplot.config.enablePlugins = true;												
															var s1 = [<?php $arreglo =  $db_frnmanager->getGraficaVelocidadJornada1($LineaMaquinaTubo, $jornada); echo $arreglo; ?>];
															var ticks = [<?php $labels =  $db_frnmanager->getLabelsJornada1(); echo $labels; ?>];												

															var grid = {
																gridLineWidth: 1.5,
																gridLineColor: 'rgb(235,235,235)',
																drawGridlines: true
															};

															plot1 = $.jqplot('chart1', [s1], {
										            // Only animate if we're not using excanvas (not in IE 7 or IE 8)..
										            animate: !$.jqplot.use_excanvas,
										            seriesDefaults:{
										            	renderer:$.jqplot.BarRenderer,
										            	pointLabels: { show: true }
										            },
										            axes: {
										            	xaxis: {
										            		renderer: $.jqplot.CategoryAxisRenderer,                        
										            		ticks: ticks,
										            		tickRenderer: $.jqplot.CanvasAxisTickRenderer
										            		,
										            		tickOptions: {

										            			angle: -45,
										            			fontSize: '8pt'
										            		}
										            	}
										            },
													//LINEA DE GRAFICA
													grid: grid,
													canvasOverlay: {
														show: true,
														objects: [
														{horizontalLine: {
															name: 'barney',
															y: 100,
															lineWidth: 6,
															color: 'rgb(89, 198, 154)',
															shadow: false
														}}
														]
													}
													,
													highlighter: { show: false }
												});

$('#chart1').bind('jqplotDataClick', 
	function (ev, seriesIndex, pointIndex, data) {
		$('#info1').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);
	}
	);
});
</script>											
</div>
<div class="panel-footer">
	Reporte Automatico.
</div>
</div>
</div>
</div>	
<div class="row clearfix">
	<div class="col-md-12 column">
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h3 class="panel-title">
					Bolsas Producidas por hora.
					<span class="badge" id="info2"></span>
				</h3>
			</div>
			<div class="panel-body">
				<!-- UNIDADES PRODUCIDAS CON RESTA										 -->
				<div class="container pull-left" id="chart2" style="padding-left: 5px; padding-right: 5px; width:100%; height:400px;">
				</div>												
				<script class="code" type="text/javascript">$(document).ready(function(){
					$.jqplot.config.enablePlugins = true;												
					var s1 = [<?php $arreglo =  $db_frnmanager->getGraficaUnidadesProducidasJornada($LineaMaquinaTubo,$jornada); echo $arreglo; ?>];
					var ticks = [<?php if ($jornada == 1) {$labels =  $db_frnmanager->getLabelsJornada1(); echo $labels;}else{$labels =  $db_frnmanager->getLabelsJornada2(); echo $labels;}  ?>];												

					plot1 = $.jqplot('chart2', [s1], {
										            // Only animate if we're not using excanvas (not in IE 7 or IE 8)..
										            animate: !$.jqplot.use_excanvas,
										            seriesDefaults:{
										            	renderer:$.jqplot.BarRenderer,
										            	pointLabels: { show: true }
										            },
										            axes: {
										            	xaxis: {
										            		renderer: $.jqplot.CategoryAxisRenderer,                        
										            		ticks: ticks,
										            		tickRenderer: $.jqplot.CanvasAxisTickRenderer
										            		,
										            		tickOptions: {

										            			angle: -45,
										            			fontSize: '8pt'
										            		}
										            	}
										            },
										            highlighter: { show: false }
										        });

					$('#chart2').bind('jqplotDataClick', 
						function (ev, seriesIndex, pointIndex, data) {
							$('#info2').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);
						}
						);
				});
</script>											
</div>
<div class="panel-footer">
	Reporte Automatico.
</div>
</div>
</div>
</div>
<div class="row clearfix">
	<div class="col-md-12 column">
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h3 class="panel-title">
					Bolsas de desperdicio.
					<span class="badge" id="info3"></span>
				</h3>
			</div>
			<div class="panel-body">
				<!-- La grafica va justo aca... -->											
				<div class="container pull-left" id="chart3" style="padding-left: 5px; padding-right: 5px; width:100%; height:400px;">
				</div>												
				<script class="code" type="text/javascript">$(document).ready(function(){
					$.jqplot.config.enablePlugins = true;												
					var s1 = [<?php $arreglo =  $db_frnmanager->getGraficaUnidadesDesperdicioJornada($LineaMaquinaTubo, $jornada); echo $arreglo; ?>];
					var ticks = [<?php if ($jornada == 1) {$labels =  $db_frnmanager->getLabelsJornada1(); echo $labels;}else{$labels =  $db_frnmanager->getLabelsJornada2(); echo $labels;}  ?>];

					plot1 = $.jqplot('chart3', [s1], {
										            // Only animate if we're not using excanvas (not in IE 7 or IE 8)..
										            animate: !$.jqplot.use_excanvas,
										            seriesDefaults:{
										            	renderer:$.jqplot.BarRenderer,
										            	pointLabels: { show: true }
										            },
										            axes: {
										            	xaxis: {
										            		renderer: $.jqplot.CategoryAxisRenderer,                        
										            		ticks: ticks,
										            		tickRenderer: $.jqplot.CanvasAxisTickRenderer
										            		,
										            		tickOptions: {

										            			angle: -45,
										            			fontSize: '8pt'
										            		}
										            	}
										            },
										            highlighter: { show: false }
										        });

					$('#chart3').bind('jqplotDataClick', 
						function (ev, seriesIndex, pointIndex, data) {
							$('#info3').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);
						}
						);
				});
</script>											
</div>
<div class="panel-footer">
	Reporte Automatico.
</div>
</div>
</div>
</div>
<div class="row clearfix">
	<div class="col-md-12 column">
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h3 class="panel-title">
					Cantidad de paros.
					<span class="badge" id="info4"></span>
				</h3>
			</div>
			<div class="panel-body">
				<!-- La grafica va justo aca... -->											
				<div class="container pull-left" id="chart4" style="padding-left: 5px; padding-right: 5px; width:100%; height:400px;">
				</div>															
				<script class="code" type="text/javascript">$(document).ready(function(){
					$.jqplot.config.enablePlugins = true;												
					var s1 = [<?php $arreglo =  $db_frnmanager->getGraficaCantidadParosJornada($LineaMaquinaTubo, $jornada); echo $arreglo; ?>];
					var ticks = [<?php if ($jornada == 1) {$labels =  $db_frnmanager->getLabelsJornada1(); echo $labels;}else{$labels =  $db_frnmanager->getLabelsJornada2(); echo $labels;}  ?>];

					var minutos = [<?php 
					try{
						$cadenaMinutos = $db_frnmanager->getMinutosParoJornada($LineaMaquinaTubo, $jornada); 													
					} catch (Exception $e) { 
						$cadenaMinutos = "0,0,0,0,0,0,0,0,0,0,0,0"; 
					} 
					echo $cadenaMinutos; 
					?>];

					for (var i = 0; i <= minutos.length - 1; i++) {
						ticks[i] = ticks[i] + " " + minutos[i] + " minutos"
					}

					plot1 = $.jqplot('chart4', [s1], {
										            // Only animate if we're not using excanvas (not in IE 7 or IE 8)..
										            animate: !$.jqplot.use_excanvas,
										            seriesDefaults:{
										            	renderer:$.jqplot.BarRenderer,
										            	pointLabels: { show: true }
										            },
										            axes: {
										            	xaxis: {
										            		renderer: $.jqplot.CategoryAxisRenderer,                        
										            		ticks: ticks,
										            		tickRenderer: $.jqplot.CanvasAxisTickRenderer
										            		,
										            		tickOptions: {

										            			angle: -45,
										            			fontSize: '8pt'
										            		}
										            	}
										            },
										            highlighter: { show: false }
										        });

					$('#chart4').bind('jqplotDataClick', 
						function (ev, seriesIndex, pointIndex, data) {
							$('#info4').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);
						}
						);
				});
</script>											
</div>
<div class="panel-footer">
	Reporte Autom&aacute;tico.
</div>
</div>
</div>
</div>
							<!-- <div class="panel panel-default">
								<div class="panel-heading">
									<h3 class="panel-title">
										Detalle de datos
									</h3>
								</div>
								<div class="panel-body">
									Ver detalle de datos... &lt;a href="detalle.php?idDatos=#"&gt; &lt;/a&gt;
								</div>
								<div class="panel-footer">
									Descripcion de detalle de datos.
								</div>
							</div> -->
							<!-- END CONTENIDO LINEA 1, MAQUINA 1 -->
						</div>
					</div>
				</div>
				<!-- END TABBED DE MAQUINAS EN LINEA 1 -->
			</div>
			<!-- END TAB 1-->
			<div class="tab-pane" id="tab-linea2">
				<p>
					Linea 2
				</p>
			</div>
			<div class="tab-pane" id="tab-linea3">
				<p>
					Linea 3
				</p>
			</div>
			<div class="tab-pane" id="tab-linea4">
				<p>
					Linea 4
				</p>
			</div>
			<div class="tab-pane" id="tab-linea5">
				<p>
					Linea 5
				</p>
			</div>
			<div class="tab-pane" id="tab-linea6">
				<p>
					Linea 6
				</p>
			</div>
			<div class="tab-pane" id="tab-linea7">
				<p>
					Linea 7
				</p>
			</div>
		</div>
	</div>			
</div>
</div>
</div>

<!-- Don't touch this! -->


<script class="include" type="text/javascript" src="js/jquery.jqplot.min.js"></script>
<script type="text/javascript" src="syntaxhighlighter/scripts/shCore.min.js"></script>
<script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.min.js"></script>
<script type="text/javascript" src="syntaxhighlighter/scripts/shBrushXml.min.js"></script>
<!-- Additional plugins go here -->

<script class="include" type="text/javascript" src="plugins/jqplot.barRenderer.min.js"></script>
<script class="include" type="text/javascript" src="plugins/jqplot.pieRenderer.min.js"></script>
<script class="include" type="text/javascript" src="plugins/jqplot.categoryAxisRenderer.min.js"></script>
<script class="include" type="text/javascript" src="plugins/jqplot.pointLabels.min.js"></script>
<script class="include" type="text/javascript" src="plugins/jqplot.canvasTextRenderer.min.js"></script>
<script class="include" type="text/javascript" src="plugins/jqplot.canvasAxisTickRenderer.min.js"></script>


<!-- End additional plugins -->

<!-- DIBUJAR LINEAS INICIA -->
<script language="javascript" type="text/javascript" src="plugins/jqplot.canvasOverlay.min.js"></script>
<!-- DIBUJAR LINEAS TERMINA -->


<script type="text/javascript">
	window.onload=function(){
		setTimeout(function() {GenerarImagen();},1250);		
	}
</script>

<script type="text/javascript">
	function GenerarImagen(){
		html2canvas($("#tabs-572768"), {
			onrendered: function(canvas) {
				var dataURL = canvas.toDataURL("image/png");
				var nombreImagen = "imgL1_1A_J1.png";
				var jornadaActual = "1";
				$.post('GenerarImagenJornadas.php',{image: dataURL,nombre: nombreImagen,jornada: jornadaActual},function(data){                                
				});
			} 
		});			
		return false;
	}
</script>

<!-- script para manuales -->
<script type="text/javascript" >
	function manualTecnico(){
		window.location.href = 'download.php?img=Ayuda/ManualTecnico.pdf';
		return false;
	}

	function manualUsuario(){
		window.location.href = 'download.php?img=Ayuda/ManualUsuario.pdf';
		return false;
	}
</script>

<!-- script para generar archivo pdf -->
<script type="text/javascript">
	function hola(){	
		var currentdate = new Date(); 
		var datetime =  currentdate.getDate() + "-"+ (currentdate.getMonth()+1)  + "-" 
		+ currentdate.getFullYear() + "-"  
		+ currentdate.getHours() + "-"  
		+ currentdate.getMinutes() + "-" 
		+ currentdate.getSeconds();

		var direcc="reportes_Jornada1/repo-"+datetime;
		html2canvas($("#tabs-572768"), {
			onrendered: function(canvas) {
				var dataURL = canvas.toDataURL("image/png");

                           // $('.imageHolder').append('<img src="'+dataURL+'" />');                            
                           // $.post('L1_1A_consulta_auxPDF.php',{image: dataURL});
                           var nombreImg = "imgL1_1A_J1.png";
                           $.post('L1_Jornada1_PDFCreator.php',{image: dataURL,direc: direcc,nombreImagen: nombreImg},function(data){                                
                                // window.alert(data);
                                //$('#test').html(data);
                                setTimeout(function() {window.location.href = 'download.php?img=reportes_Jornada1\/repo-'+datetime+'.pdf';},2250);
                            });

                       } 
                   });


		window.alert("Archivo PDF de reporte generado.");		
		return false;
	}
</script>

</body>
</html>
<?php 
}else{header( 'Location: ErrNoSession.php');}
?>